/**我的关系JS代码*/
$(function(){
	 	$('.attention li').click(function(){
			var index = $(this).index();
			$(this).addClass('attention-current').siblings().removeClass('attention-current');
		});
});

/**
 * 发送站内消息
 */
function sendMsg(){
	var chName = $('#chName');
	var receiveId = $('#receiveId');
	var msgContent = $('#msgContent');
	if(chName.val() =='' || receiveId.val() == '' || msgContent.html() == ''){
		alert('接收对象和内容不能为空!');
		return;
	}
	$.ajax({
		type:'POST',
		url:'user/notifications/sendMsg',
		data:{msgContent:$('#msgContent').html(),userId:$('#receiveId').val()},
		dataType:'json',
		success:function(data){
					if(data && data.success){
							alert(data.message);
							msgContent.html('');
							$('#receiveId').val('');
							$('#chName').val('');
					}else{
							alert(data.message);
					}
		}
	});
}

function choiceFriend(event){
	$(event.target).addClass('letter-current').siblings().removeClass('letter-current');
	$('#chName').val($(event.target).html());
	$('#receiveId').val($(event.target).attr('name'));
}
			